import HomePage from '../page/HomePage'

// 路由配置
export const routes = [
  {
    path: '/',
    name: 'home',
    component: HomePage,
    title: '工时管理',
    meta: {
      requiresAuth: false,
      keepAlive: true,
    },
  },
  // 为将来扩展预留的路由
  // {
  //   path: '/reports',
  //   name: 'reports',
  //   component: ReportsPage,
  //   title: '报表分析',
  //   meta: {
  //     requiresAuth: false,
  //     keepAlive: true,
  //   },
  // },
  // {
  //   path: '/settings',
  //   name: 'settings',
  //   component: SettingsPage,
  //   title: '系统设置',
  //   meta: {
  //     requiresAuth: false,
  //     keepAlive: false,
  //   },
  // },
]

// 获取当前路由
export const getCurrentRoute = () => {
  // 简单的路由匹配，未来可以集成 React Router
  const path = window.location.pathname
  return routes.find((route) => route.path === path) || routes[0]
}

// 导航函数（预留）
export const navigateTo = (path) => {
  // 简单的导航实现，未来可以用 React Router 替代
  console.log(`导航到: ${path}`)
  // window.history.pushState({}, '', path)
}
